const int MaxSize=10;
int   visited[MaxSize]; 
template <class T>
class MGraph
{
   public:
      MGraph(T a[ ],int n,int e );   
       void DFS(int v); 
       void BFS(int v); 
   private:
       T vertex[MaxSize]; 
       int arc[MaxSize][MaxSize]; 
       int vertexNum, arcNum; 
};
struct ArcNode
{    int adjvex; 
      ArcNode *next;
};
template <class T>
struct VertexNode 
{
      T vertex;
      ArcNode *firstedge;
};
template <class T>
class ALGraph
{    
   public:
       ALGraph(T a[ ], int n, int e);   
       ~ALGraph();    
       void DFS(int v);    
       void BFS(int v);        
  private:
       VertexNode<T> adjlist[MaxSize];   
       int vertexNum, arcNum;
	         
};

